<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fawri | Question</title>
<!-- STYLES -->
<link rel="stylesheet" type="text/css" href="css/style.css" />

<script type="text/javascript"><? session_start(); //echo ; 
 $today= date('Y-m-d');
 $x=date('Y/m/d');

$lastaccess= date( 'Y/m/d', strtotime( $_SESSION ['last_access']) );
if ($x==$lastaccess){
	echo "self.location.href = 'thanks.php';";
}


?></script>
</head>

<body>

<!-- APP WARPER -->
<div class="warper"> 
  <!-- content left side -->
  <div class="left-side">
  <?php 
  include('config.php');
  $question = mysql_query("SELECT * FROM fawri_questions where question_date='".$today."'");
	$question = mysql_fetch_array($question);
  ?>
    <div class="question"> <? echo $question['question'] ?></div>
    <div class="options">
      <ul>
      <?php 
		  $answers = mysql_query("SELECT * FROM fawri_answers where question_id=".$question['question_id']."");
			while ($answer = mysql_fetch_array($answers)){
		  ?>
        <a href="thanks.php?a=<? echo $answer['answer_id']; ?> " >
        <li> <? echo $answer['answer']; ?> </li>
        </a>
        <?   }?>
        
      </ul>
    </div>
    <!-- back btn --> 
    
  </div>
  <div class="right-side"> <a href="#" class="logo "> </a>
    <div class="question-num clearfix"> السؤال رقم <span><? echo  $question['question_order'] ; ?></span> </div>
    <?php 
	session_start();
    $comments = mysql_query("SELECT user_score FROM fawri_users where user_fbid=".$_SESSION ['id']."");
	$comment = mysql_fetch_array($comments);
	?>
    <span class="points"> <span><?php echo $comment['user_score']; ?></span> </span> </div>
	<? mysql_close($con); ?>
</div>
</body>
</html>
